import Vue from 'vue'
import Vuex from 'vuex'

// 引入模块
import mutations from './mutations'
import getters from './getters'
import actions from './actions'

// 1.加载Vuex
Vue.use(Vuex)

// 3.抽离state
const state = {
  cartList: []
}

// 2.创建实例
const store = new Vuex.Store({
  state,
  getters,
  actions,
  mutations
})

export default store
